
layui.config({
	base: basePath, 
	version: skyeyeVersion
}).define(['table', 'jquery', 'winui'], function (exports) {
	winui.renderColor();
	layui.use(['form'], function (form) {
		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
	    var $ = layui.$,
	    form = layui.form;
	    
		form.render();
		
	    form.on('submit(formAddBean)', function (data) {
	    	//表单验证
	        if (winui.verifyForm(data.elem)) {
        		var params = {
    				requireName: $("#requireName").val(),
    				formerRequirement: $("#formerRequirement").val(),
    				afterRequirement: $("#afterRequirement").val(),
        		};
        		
        		AjaxPostUtil.request({url:reqBasePath + "dsformlimitrequirement002", params:params, type:'json', callback:function(json){
        			if(json.returnCode == 0){
        				parent.layer.close(index);
        				parent.refreshCode = '0';
        			}else{
        				top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
        			}
        		}});
	        }
	        return false;
	    });
	    
	    //取消
	    $("body").on("click", "#cancle", function(){
	    	parent.layer.close(index);
	    });
	    
	});
	    
});